package com.gton.service;

import com.gton.entity.GpLogin;
import com.gton.io.Resp;
import com.gton.router.RemoteUserManageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @description: 基于dubbo实现远程过程调用
 * @author: GuoTong
 * @createTime: 2022-09-24 17:40
 * @since JDK 1.8 OR 11
 **/
@Service
@Slf4j
public class DubboRPCThirdSysRouterService {


    /**
     * Description: dubbo RPC  消息请求方  @DubboReference
     *
     * @author: GuoTong
     * @date: 2022-09-24 17:53:33
     */

    @DubboReference
    private RemoteUserManageService remoteUserManageService;

    public Resp<Map<String, Object>> getUserManagerService_Hello(String TraceId, String userName) {
        log.info("[{}]:dubbo RPC方式请求发送出去！！！！", TraceId);
        return remoteUserManageService.getUserManagerService_Hello(TraceId, userName);
    }

    public Resp databaseUpdate(GpLogin gpLogin) {

        log.info("[{}]:dubbo RPC方式请求发送出去！！！！", "Seata");
        return remoteUserManageService.databaseUpdate(gpLogin);

    }
}
